<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<!-- 由于此代码中没有声明模块，故直接写ng-app -->
<body ng-app>

        <div ng-controller="demoCtrl">
            <h2>{{title}}</h2>
        </div>


        <div ng-controller="demoCtrl1">
            <h2>{{title}}</h2>
        </div>


</body>
<!-- <script src="../libs/js/angular-1.6.9.min.js"></script> -->
<script src="./libs/js/angular-1.2.30.js"></script>
<script>
    //这种写法只在低版本中有效，也不推荐这些写，故高版本中已废弃此种写法（了解即可）
    function demoCtrl($scope){
        $scope.title="全局函数充当控制器";
        console.log($scope);
    }

    function demoCtrl1($scope){
        $scope.title="全局函数充当控制器1";
        console.log($scope);
    }
</script>
</html>